Conversation
There was a problem hiding this comment.
Pull request overview
Updates the source generator to avoid naming collisions when multiple additional interfaces share the same type name across different namespaces, and adds regression tests to ensure the generated API remains unique and usable.
Changes:
- Track and reuse “used member names” across generated partial extension sources for the same base mock type.
- Add source-generator test coverage validating conflict resolution via indexed naming.
- Add runtime test ensuring the correct additional-interface setup/verify members are available per mock instance.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| Tests/Mockolate.Tests/MockTests.CreateTests.cs | Adds an integration-style test that exercises unique setup/verify member names when additional interfaces have conflicting simple names. |
| Tests/Mockolate.SourceGenerators.Tests/MockGeneratorTests.cs | Adds a generator test asserting indexed filenames and uniquely named setup/verify members for conflicting additional interfaces. |
| Source/Mockolate.SourceGenerators/Sources/Sources.ForMock.CombinationExtensions.cs | Extends generator source emission to accept a shared set of used names rather than recreating it per file. |
| Source/Mockolate.SourceGenerators/MockGenerator.cs | Introduces per-base-type tracking of used member names and passes it into extension generation to prevent partial-type member collisions. |
🚀 Benchmark ResultsDetails
|
|
|
This is addressed in release v1.5.0. |



Updates the source generator to avoid naming collisions when multiple additional interfaces share the same type name across different namespaces, and adds regression tests to ensure the generated API remains unique and usable.
Key Changes: